package com.cysd.ewmxns.sdw_ui.activity

import android.os.Bundle
import com.cszy.ewmxns.base.BaseVMActivity

import com.cysd.ewmxns.sdw_utils.ClipboardUtils
import com.cysd.ewmxns.sdw_viewmodel.MainViewModel
import com.hlyj.http.ad.NewGroMoreFeedAdManager
import com.hnyyac.ad.mds.IAdView
import com.hnyyac.ad.mds.IAdViewListener
import com.hnyyac.ad.mds.manager.AdManager
import com.hnyyac.ad.mds.manager.AdManager.AdLoadListener
import com.hnyyac.ad.mds.utils.BaseAdConstants
import qrrspeeelild.rqrc0ode.andro0ild.databinding.ActivityScanResultBinding


class Sdw_ScanResultActivity : BaseVMActivity<MainViewModel, ActivityScanResultBinding>(),IAdViewListener {
    private var newGromoreFeedAd : NewGroMoreFeedAdManager? =null
    override fun initView(savedInstanceState: Bundle?) {
           mBinding.headTitle.headCenterTitle.text = "扫描结果"
    }

    override fun initData() {
        val scanResult = intent.getStringExtra("scanResult")
        mBinding.tvResult.text = scanResult
        AdManager.loadChapin_nocache(
            this,
            61,
            this,
            object : AdLoadListener {
                override fun onAdLoadFailed(ad: IAdView?) {
                    newGromoreFeedAd = NewGroMoreFeedAdManager(this@Sdw_ScanResultActivity, BaseAdConstants.FEEDAD_Id, mBinding?.fragmentContainer,62)
                    newGromoreFeedAd?.loadAd()
                }
            })
    }

    override fun initListener() {
        mBinding.headTitle.headBack.setOnClickListener {
            finish()
        }
        mBinding.tvCopy.setOnClickListener {
            ClipboardUtils.copyTextFromTextView(this, mBinding.tvResult) // 默认显示 Toast
        }
    }

    override fun onTrigger(adView: IAdView) {

    }

    override fun onAdShow(adView: IAdView) {

    }

    override fun onAdClick(adView: IAdView) {

    }

    override fun onAdClose(adView: IAdView) {
        newGromoreFeedAd = NewGroMoreFeedAdManager(this@Sdw_ScanResultActivity, BaseAdConstants.FEEDAD_Id, mBinding?.fragmentContainer,62)
        newGromoreFeedAd?.loadAd()
    }

    override fun onError(msg: String) {

    }

    override fun onLoadError(adView: IAdView) {

    }

    override fun onSuccess(adView: IAdView) {

    }

    override fun onLoad(adView: IAdView) {

    }

    override fun onSkipped() {

    }

    override fun onNoAd() {

    }

    override fun onTimeOut() {

    }

}